<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>

<!--完结审核弹窗  -->

<div  class="content-warp">
    <div class="distribPersonel" id="transferOrderPageBox" style="padding: 20px 20px">
        <form action="" id="transferOrderBoxForm" >
            <table class="dggui-table-info">
                <tbody>
                <c:if test="${!empty id}">
                    <input name="scOrderId" type="hidden" value="${id}">
                </c:if>
                <c:if test="${fn:length(orderList) > 1}">
                    <tr>
                        <th colspan="2">
                            <table id="orderTable" class="dggui-table cell-border table-form nodeTable">
                                <tr style="text-align: center">
                                    <td><b>序号</b></td>
                                    <td><b>生产单号</b></td>
                                    <td><b>合同号</b></td>
                                    <td><b>操作</b></td>
                                </tr>
                                <c:forEach items="${orderList}" var="order" varStatus="status">
                                    <tr style="text-align: center">
                                        <td>${status.index + 1}</td>
                                        <td>${order.scProductOrderNo}<input name="scOrderId" type="hidden" value="${order.id}"></td>
                                        <td>${order.contractNo}</td>
                                        <td><input class="dggui-btn" type="button" onclick="removeOrder(this)" value="剔除"></td>
                                    </tr>
                                </c:forEach>
                            </table>
                        </th>
                    </tr>
                </c:if>
                <tr>
                    <th><span class="required">审核结果：</span></th>
                    <td>
                        <label class="ali-radio"><input type="radio" name="auditResult" value="0" checked>同意</label>
                        <label class="ali-radio"><input type="radio" name="auditResult" value="1">驳回</label>
                    </td>
                </tr>
                <%--<p id="abandonReasonNum" name="abandonReasonNum" data-abandonReasonNum="${productOrder.abandonReasonNum}"  hidden></p>--%>
                <tr>
                    <th ><span>备注：</span></th>
                    <td>
                     <textarea placeholder="请填写备注,1-500字" class="dggui-textarea" id="remark" name="remark" maxlength="500"></textarea>
                    </td>
                </tr>
                </tbody>
            </table>
        </form>
    </div>
</div>
<script type="text/javascript">
    function removeOrder(obj) {
        var num = $("#orderTable").children().children("tr").length;
        if(num == 2){
            dggui.dialog.errors("请至少保留一个订单!");
            return;
        }
        $(obj).parent().parent().remove();
    }
</script>